<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>${config.siteName}后台系统</title>
    <link href="/assets/images/favicon.ico" rel="shortcut icon" type="image/x-icon">
    <link href="/assets/static/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="/assets/static/bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="/assets/css/jquery-confirm.min.css" rel="stylesheet">
    <link href="/assets/static/fancybox/jquery.fancybox.min.css" rel="stylesheet">
    <link href="/assets/static/nprogress/nprogress.css" rel="stylesheet">
    <link href="/assets/static/toastr/toastr.min.css" rel="stylesheet">
    <link href="/assets/static/icheck-1.x/skins/square/green.css" rel="stylesheet">
    <link href="/assets/static/icheck-1.x/skins/futurico/futurico.css" rel="stylesheet">
    <link href="/assets/static/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="/assets/static/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
    <link href="/assets/static/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
    <link href="/assets/static/zTree_v3/css/metroStyle/metroStyle.css" rel="stylesheet">
	<link href="/assets/static/bootstrap-fs-modal/dist/css/fs-modal.min.css" rel="stylesheet">
    <link href="/assets/css/yyl.core.css" rel="stylesheet">
    <script src="/assets/js/jquery-1.11.1.min.js" type="text/javascript"></script>
	<script src="/assets/static/bootstrap-3.3.7/js/bootstrap.min.js" type="text/javascript"></script>
	<script src="/assets/static/jquery_lazyload/jquery.lazyload.min.js" type="text/javascript"></script>
	<script src="/assets/js/jquery-confirm.min.js" type="text/javascript"></script>
	<script src="/assets/static/fancybox/jquery.fancybox.min.js" type="text/javascript"></script>
	<script src="/assets/static/mustache/mustache.min.js" type="text/javascript"></script>
	<script src="/assets/static/js-xss/dist/xss.min.js" type="text/javascript"></script>
	<script src="/assets/static/nprogress/nprogress.js"></script>
	<script src="/assets/static/toastr/toastr.min.js"></script>
	<script src="/assets/static/icheck-1.x/icheck.js"></script>
	<script src="/assets/static/bootstrap-table/bootstrap-table.min.js"></script>
	<script src="/assets/static/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
	<script src="/assets/static/bootstrap-daterangepicker/moment.min.js"></script>
	<script src="/assets/static/bootstrap-daterangepicker/daterangepicker.js"></script>
	<script src="/assets/static/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
	<script src="/assets/static/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
	<script src="/assets/static/bootstrap-select-1.13.2/bootstrap-select.js"></script>
	<script src="/assets/static/bootstrap-select-1.13.2/i18n/defaults-zh_CN.js"></script>
	<script src="/assets/static/bootstrap-progressbar/bootstrap-progressbar.js"></script>
	<script src="/assets/static/zTree_v3/js/jquery.ztree.core.min.js"></script>
	<script src="/assets/static/zTree_v3/js/jquery.ztree.excheck.min.js"></script>
	
	<script src="/assets/static/bootstrap-fs-modal/dist/js/fs-modal.min.js"></script>
	<script src="/assets/js/validator.js"></script>
	<script src="/assets/js/ajaxfileupload.js"></script>
	<script src="/assets/js/jquery-form.js"></script>
	<script src="/assets/js/wangEditor.min.js" type="text/javascript"></script>
	<script src="/assets/js/yyl.tool.js"></script>
	<script src="/assets/js/yyl.upload-preview.js"></script>
	<script src="/assets/js/yyl.core.js"></script>
	<script src="/assets/js/yyl.table.js"></script>
	
    
     <style>
        .hbody {
            height:100%;
            margin:0;
            padding:0;
            color: #73879C;
		    background: #ffffff;
		    font-family: "Helvetica Neue", Roboto, Arial, "Droid Sans", sans-serif;
		    font-size: 13px;
		    font-weight: 400;
		    line-height: 1.471
        }
        .t_panel {
		    width: 100%;
		    height:100%;
		    padding: 0px 0px 0px 0px;
		    display: inline-block;
		    background: #fff;
		    border: 0px solid #E6E9ED;
		    overflow:hidden;
		    -webkit-column-break-inside: avoid;
		    -moz-column-break-inside: avoid;
		    column-break-inside: avoid;
		    opacity: 1;
		    transition: all .2s ease
		}
        .t_title {
            width:100%;
            height:4rem;
            line-height:4rem;
            position:absolute;
            z-index:5;
            top:0;
            text-align:center;
        }
        

        .t_content {
            width:100%;
            overflow:auto;
            top:8rem;
            position:absolute;
            z-index:10;
            bottom:4rem;
            padding: 0 5px 6px;
		    float: left;
		    clear: both;
		    margin-top: 5px;
        }
        .t_footer {
            height:4rem;
            line-height:4rem;
            width:100%;
            position:absolute;
            z-index:200;
            bottom:0;
            text-align:center;
        }
    </style> 
    
</head>
<body>

<form id="evalForm" class="form-horizontal form-label-left form-inline" novalidate>
    <div class="clearfix"></div>
            <div class="x_panel">
                <div class="x_title">
                    <h3 class="display-5 text-center">${child.bizChildrenType.evalName} &nbsp;&nbsp;&nbsp;  全人(个体化)发展评估记录表
                    <!-- <script type="text/javascript">
                    $(document).ready(function(){
	                    $('#checkbox_51').on('ifChecked', function(event){
	                    	$('#evalForm').append($('<input type="hidden" name="checkbox_51"  value="on"   />'));  
	                    });
	                    $('#checkbox_52').on('ifChecked', function(event){
	                    	$('#evalForm').append($('<input type="hidden" name="checkbox_52"  value="on"   />'));  
	                    });
	                    $('#checkbox_51').on('ifUnchecked', function(event){
	                    	$('input[name="checkbox_51"]').remove();
	                    	
	                    });
	                    $('#checkbox_52').on('ifUnchecked', function(event){
	                    	$('input[name="checkbox_52"]').remove();
	                    	
	                    });
                    });
                    </script> -->
                    </h3>
                    <!-- <h4 class="display-6 text-center">(适应此表的迟缓儿包括:<label class="display-4"><input type="checkbox" class="square" name="original" >胼胝体发育不全；</label><label class="display-4"><input type="checkbox" class="square" name="original" >罕见疾病；</label><label class="display-4"><input type="checkbox" class="square" name="original" >脑伤痉挛或松弛型</label>)</h4> -->
                    <h4 class="display-6 text-center">${child.bizChildrenType.evalComment}</h4>
                    <h5 class="display-6 text-justify">姓名：${child.childName }  &nbsp;
                    		生日：  ${(child.birthday)?string("yyyy年MM月dd日") } &nbsp;
                    		年龄：  ${child.age} &nbsp;                                      
                    		  性别：<#if child.sex == '0'>男<#elseif child.sex == '1'> 女<#elseif child.sex== '2'>秘密 <#else>未知</#if>      </h5>
                    		  
                    		  
                    		  <!-- ${((.now?string("yyyy"))!)?number - ((child.birthday?string("yyyy"))!(.now?string("yyyy")))?number}  -->
                    <div class="clearfix"></div>
                </div>
                <div class="x_content">
                    
                        <input type="hidden" name="intEvaluation" value="${child.intEvaluation}">
                        <input type="hidden" name="childId" value="${id}">
                        <input type="hidden" name="version" value="${version}">
                        <div class="row">
                        		 <@childTag method="evalTemplate" childId="${id}" intEvaluation="${child.intEvaluation}">
					                <#if evalTemplate?? && evalTemplate?size gt 0>
					                    <#list evalTemplate as item>
					                    		${item.tabb?default('')}
	                                           	<tr ${item.attroftr?default('')} class="${item.trclasscss?default('text-left')}" style="${item.trstylecss?default('border:0px solid #000;')}">
												   <#if item.tds?? && item.tds?size gt 0>
												   	   
			                                                 <#list item.tds as td>
			                                                 
			                                                 <#if td.std =="1">
			                                                  <td ${td.attr }>
			                                                  </#if>
			                                                  	<label class="${td.labelclasscss?default('')}" style="${td.labelstylecss?default('')}">
			                                                	 <#if td.inputtype?? && td.inputtype !="" >
			                                                		
			                                                     	<span class="required"> ${td.inputbeforeval?default('&nbsp;&nbsp;&nbsp;&nbsp;')}</span>
			                                                     	<${td.tag?default('input')} type="${td.inputtype }" style="${td.inputstylecss?default('')}" class="${td.inputclasscss?default('')}" name="${td.inputtype }_#{td.id}" id ="${td.inputtype }_#{td.id}"  ${td.attr }></${td.tag?default('input')}> 
			                                                     	<span class="required"> ${td.inputafterval?default('&nbsp;&nbsp;&nbsp;&nbsp;')}</span>
			                                                     	
			                                                     <#else>
			                                                     ${td.inputbeforeval?default('&nbsp;&nbsp;&nbsp;&nbsp;')} ${td.context} ${td.inputafterval?default('&nbsp;&nbsp;&nbsp;&nbsp;')}
			                                                    
			                                                     </#if>
			                                                     </label>
			                                                     <#if td.etd =="1">
			                                                    </td>
			                                                    </#if>
			                                                </#list>
		                                               
		                                            <#else>
		                                            
		                                            </#if>
												</tr>
												${item.taba?default('')}  
					                    </#list>
					                </#if>
					            </@childTag>
					            
					            
								<#--  <@childTag method="evalTemplate" childId="${id}" intEvaluation="${child.intEvaluation}">
					                <#if evalTemplate?? && evalTemplate?size gt 0>
					                    <#list evalTemplate as item>
					                    		${item.contextr?default('')}
	                                           	<tr ${item.attrs?default('')} class="${item.liclasscss?default('text-left')}" style="${item.listylecss?default('border:0px solid #000;')}">
												   <#if item.columns?? && item.columns?size gt 0>
												   	   
			                                                 <#list item.columns as column>
			                                                 
			                                                 <#if column.std =="1">
			                                                  <td ${column.attr }>
			                                                  </#if>
			                                                  	<label class="${column.labelclasscss?default('')}" style="${column.labelstylecss?default('')}">
			                                                	 <#if column.inputtype?? && column.inputtype !="" >
			                                                		
			                                                     	<span class="required"> ${column.inputbeforeval?default('&nbsp;&nbsp;&nbsp;&nbsp;')}</span>
			                                                     	<${column.tag?default('input')} type="${column.inputtype }" style="${column.inputstylecss?default('')}" class="${column.inputclasscss?default('')}" name="${column.inputtype }_#{item.id}_${column.num}" id ="${column.inputtype }_#{item.id}_${column.num}"  ${column.attr }></${column.tag?default('input')} 
			                                                     	<span class="required"> ${column.inputafterval?default('&nbsp;&nbsp;&nbsp;&nbsp;')}</span>
			                                                     	
			                                                     <#else>
			                                                     ${column.inputbeforeval?default('&nbsp;&nbsp;&nbsp;&nbsp;')} ${column.context} ${column.inputafterval?default('&nbsp;&nbsp;&nbsp;&nbsp;')}
			                                                    
			                                                     </#if>
			                                                     </label>
			                                                     <#if column.etd =="1">
			                                                    </td>
			                                                    </#if>
			                                                </#list>
		                                               
		                                            <#else>
		                                            
		                                            </#if>
												</tr>
												${item.remarkr?default('')}  
					                    </#list>
					                </#if>
					            </@childTag> -->
							
							
							<#-- 
							<ul class="list-unstyled">
								 <@childTag method="evalTemplate" childId="${id}" intEvaluation="${child.intEvaluation}">
					                <#if evalTemplate?? && evalTemplate?size gt 0>
					                    <#list evalTemplate as item>
	                                           	<li class="${item.liclasscss?default('text-left col-md-12 col-sm-12 col-xs-12')}" style="${item.listylecss?default('font-size:15px')}" >
												   <#if item.columns?? && item.columns?size gt 0>
		                                                <#list item.columns as column>
		                                                	 <#if column.inputtype?? && column.inputtype !="" >
		                                                	  <label class="${column.labelclasscss}" style="${column.labelstylecss}" for="${column.inputtype }_#{item.id}_${column.num}">
		                                                     	<span class="required"> ${column.inputbeforeval?default('&nbsp;&nbsp;&nbsp;&nbsp;')}</span>
		                                                     	<input type="${column.inputtype }" style="${column.inputstylecss?default('')}" class="${column.inputclasscss?default('')}" name="${column.inputtype }_#{item.id}_${column.num}" id ="${column.inputtype }_#{item.id}_${column.num}"  ${column.attr }>
		                                                     	<span class="required"> ${column.inputafterval?default('&nbsp;&nbsp;&nbsp;&nbsp;')}</span>
		                                                       </label>
		                                                     <#else>
		                                                     ${column.context}
		                                                     </#if>
		                                                   
		                                                </#list>
		                                            <#else>
		                                            
		                                            </#if>
												</li>
					                    </#list>
					                </#if>
					            </@childTag>
							</ul>
							 -->
						</div>
                        
						<div class="row">
							<div class="col-md-4 col-sm-12 col-xs-12">
                                  <label class="control-label" for="select_trainer">负责训练者: <span class="required">*</span></label>
                                  <select class="form-control" name="select_trainer" required="required" id="select_trainer" ">
                                      <@yyTag method="dicts" dictType="TRAINER">
		                                    <#if dicts?? && dicts?size gt 0>
		                                        <#list dicts as dict>
		                                            <option value="${dict.dictTypeId}">${dict.dictTypeName}</option>
		                                        </#list>
		                                    <#else>
		                                        <option value="">请选择</option>
		                                    </#if>
		                                </@yyTag>
                                  </select>
                              </div>
                              <div class="col-md-4 col-sm-12 col-xs-12">
                                 <label class="control-label" for="select_advocate">咨询评估师: <span class="required">*</span></label>
                                  <select class="form-control" name="select_advocate" required="required" id="select_advocate">
                                  	  <@yyTag method="dicts" dictType="ADVOCATE">
		                                    <#if dicts?? && dicts?size gt 0>
		                                        <#list dicts as dict>
		                                            <option value="${dict.dictTypeId}">${dict.dictTypeName}</option>
		                                        </#list>
		                                    <#else>
		                                        <option value="">请选择</option>
		                                    </#if>
		                                </@yyTag>
                                  </select>
                              </div>
                              <div class="col-md-4 col-sm-12 col-xs-12">
                              		<label class="control-label" for="select_evaldate">评估日期: <span class="required">*</span></label>
		                                <input type='text' class="form-control" required="required" id="select_evaldate" name="select_evaldate" placeholder="请输入评估日期"/>
		                        </div>
                              
                          </div>
  		                
                        <div class="ln_solid"></div>
                     	
                    
                    
                     
                </div>
                
                <div class="x_footer">
                            <div class="col-md-12 col-sm-12 col-xs-12">
                                <button type="button" class="btn btn-success saveBtn"><i class="fa fa-pencil"> 保存</i></button>
                                <button type="button" class="btn btn-primary" onclick="javascript:history.back(-1);"><i class="fa fa-undo"> 返回</i></button>
                                <button type="button" class="btn btn-primary resetBtn"><i class="fa fa-undo"> 重置</i></button>
                            </div>
                        </div>  
            </div>
</form>
	<script type="text/javascript">
	 
	 
      
      var appConfig = {
    	        qiniuPath: '${config.qiuniuBasePath}',
    	        qiniuImgStyle: '-pw',
    	        wwwPath: '${config.siteUrl}',
    	        staticPath: '${config.staticWebSite}'
     }
	 
	 $('.resetBtn').on('click', function () {
	        console.log("开始重置表单");
	        $(':input','#evalForm')
	        .not(':button,:submit,:reset,:hidden,:checkbox,:radio')  
	        //.removeAttr('value');
	        .val('');
	        $('input[type=checkbox]').iCheck('uncheck');
	    });
	 
      $.ajax({
    	    type : "post",
    	    url : "/sysdict/list/"+'TRAINER', //此次url改为真正需要的url
    	    success : function(data, status) {
    	        $.each(data, function(index, item) {
    	            $("#select_trainer").append("<option value="+item.id+">" + item.name+ "</option>");
    	            $("#select_advocate").append("<option value="+item.id+">" + item.name+ "</option>");
    	        });
    	    },
    	});
      
      
      $(document).ready(function(){
          var callbacks_list = $('.list-unstyled li');
          //event.type.replace('if', '').toLowerCase()
         
           <@childTag method="evalEvent" childId="${id}" intEvaluation="${child.intEvaluation}">
               <#if evalEvent?? && evalEvent?size gt 0>
                   <#list evalEvent as item>
                   			<#if item.columnId?contains("checkbox")>
                   				
                   			
		                   		  $('#${item.columnId}').on('ifChecked', function(event){
			                   			<#if item.beforeColId??>
		                 			 		  $('#${item.beforeColId}').iCheck('check');
			                          		  $('#${item.beforeColId}').iCheck('disable');
			                          		  var tmpinput=$("<input type='hidden'/>");
			                          		  tmpinput.attr("id","id${item.beforeColId}");
			                          		  tmpinput.attr("name","name${item.beforeColId}");
			                          		  tmpinput.attr("value","on");
			                          		  $('#id${item.beforeColId}').remove();
			                          		  $('#evalForm').append(tmpinput);
			                          		  
					                          <@childTag method="befores" childId="${id}" intEvaluation="${child.intEvaluation}" beforeColId="${item.beforeColId}">
		                        		  			<#if befores?? && befores?size gt 0>
		                        		  			
		                        		  		 		<#list befores as bs>
		                        		  		 			<#if bs.corrId?contains('checkbox')>
		                        		  		 				$('#${bs.corrId}').iCheck('uncheck');
		                        		  		 			<#else>
		                        		  		 				$('#${bs.corrId}').val('');
		                        		  		 			</#if>
		                        		  		 		
		                        		  		 		</#list>
		                        		  		 	</#if>
		                    		         </@childTag>
	            		  			    </#if>
		                   			  
		                   			   <#if item.tds?? && item.tds?size gt 0>
		                   						<#list item.tds as column>
				                   						<#if column.corrId?contains('checkbox')>
					                   			 		 		$("#${column.corrId}").iCheck('${column.corrVal}');
					                            		 <#else>
					                                   			$("#${column.corrId}").val('${column.corrVal}');
					                                    </#if>
					                             </#list>
		                   				</#if>
		                   				
		                   				
		                   				
		                          });
		                           /*checkbox 没被选中触发事件。1.先清除关联关系。2找到上一个组件关联关系*/
		                          $('#${item.columnId}').on('ifUnchecked', function(event){
		                        	  
			                        	  <#if item.tds?? && item.tds?size gt 0>
	                 						<#list item.tds as column>
			                   						<#if column.corrId?contains('checkbox')>
				                   			 		 		$("#${column.corrId}").iCheck('uncheck');
				                            		 <#else>
				                                   			$("#${column.corrId}").val('');
				                                    </#if>
				                             </#list>
	                 				     </#if>
		                        	  
		                 				    <#if item.beforeColId??>
		           			 					$('#${item.beforeColId}').iCheck('enable');
		           			 					$('#${item.beforeColId}').iCheck('uncheck');
		           			 					$('#${item.beforeColId}').iCheck('check');
						            	 		$('#id${item.beforeColId}').remove();
											</#if>
		                           });
                          
                   			</#if>
                  </#list>
            </#if>
           </@childTag>
        
        
         
       }); 
      
      
      
     

	// 点击保存
	 $(".saveBtn").click(function () {
	     if(validator.checkAll($("#evalForm"))) {
	    	 $("#evalForm").ajaxSubmit({
	             type: "post",
	             url: "/child/saveEvalContent",
	             success: function (json) {
	                 $.alert.ajaxSuccess(json, function () {
	                     window.location.href = '/child';
	                 });
	             },
	             error: $.alert.ajaxError
	         });
	     }
	 });
	
	  $('#select_evaldate').datetimepicker({
			 language:  'zh-CN',  
			 minView: "month",//设置只显示到月份
		     format: 'yyyy-mm-dd',
          ignoreReadonly: true,
          allowInputToggle: true,
          autoclose:true,//选中关闭
          pickerPosition: "bottom-left"
      });
	  
	  $('#select_evaldate').attr("value",new Date().format("yyyy-MM-dd"));
	  
	  $('#myDatepicker').datetimepicker({
			 language:  'zh-CN',  
			 minView: "month",//设置只显示到月份
		     format: 'yyyy-mm-dd',
          ignoreReadonly: true,
          allowInputToggle: true,
          autoclose:true,//选中关闭
          pickerPosition: "bottom-left"
      });
	
</script>

    </body>
</html>